<!DOCTYPE HTML>
<html>
<head>
    <title>我的报修历史</title>
    <% include common/meta.ejs %>
    <% include common/public.ejs %>
    <link href="//cdn.bootcss.com/Swiper/3.4.1/css/swiper.min.css" rel="stylesheet">
    <style>
        body{
            font-size: 13px;
        }
        .uploadImage div {
            margin-left: 0.1rem;
        }
        .acnt_img {
            width: 70px;
            height: 70px;
            border-radius: 10px;
            margin: 5px;
            overflow: hidden;
        }
        .acnt_img img {
            width: 100%;
            height: 100%;
        }
        .dl-horizontal dt {
            clear: left;
            float: left;
            overflow: hidden;
            text-align: right;
            text-overflow: ellipsis;
            white-space: nowrap;
            width: 25%;
            padding: 0 5px;
        }

        .dl-horizontal dd {
            color: #999999;
        }
        .uploadImage img {
            width: 100%;
            height: 100%;
        }
        .weui_panel{
            overflow-y: scroll;
            height:100%;
            width: 100%;
        }
    </style>
</head>
<body ontouchstart="">
<div class="weui_tab">
    <div class="weui_navbar">
        <a class="weui_navbar_item" href="bill?openId=<%= session.openId %>">
            账单
        </a>
        <a class="weui_navbar_item weui_bar_item_on" href="repairList?openId=<%= session.openId %>">
            报修
        </a>
        <a class="weui_navbar_item" href="clean?openId=<%= session.openId %>">
            保洁
        </a>
    </div>
    <div class="weui_panel">
        <div style="height: 35px;"></div>
        <div class="weui_panel_hd">所有报修单</div>
        <div class="weui_panel_bd">
        <% for(var i = 0;i < data.length;i++) { %>
            <div class="weui-row padded-5" style="border-bottom: 1px solid #EEEEEE;">
                <div class="weui-col-20">
                    <div class="acnt_img">
                        <!--<img src="<%= data[i].userImg %>" alt="">-->
                        <img src="/uploadFiles/repair/<%= data[i].medias[0] + '.jpg' %>">
                    </div>
                </div>
                <div class="weui-col-80">
                    <a href="repairInfo?id=<%= data[i].id %>"
                       class="pull-right contract-img" style="font-size: 0.7rem;">详情...</a>
                    <dl class="dl-horizontal">
                        <dt>报修时间</dt>
                        <dd><%= data[i].issueTime %></dd>


                        <dt>设备类型</dt>
                        <dd><%= data[i].type || '未指明' %></dd>

                        <dt>详细地址</dt>
                        <dd><%= data[i].address %></dd>
                        <dt>详细描述</dt>
                        <dd><%= data[i].remark || '暂无描述' %></dd>
                        <dt>当前状态</dt>
                        <dd><%= data[i].statusName %></dd>
                    </dl>
                   <!-- <div style="display: flex;" class="uploadImage" id="mySubmitImage" onclick="showImage(this);">
                        <% var mymedia=[]; for(var k = 0;k < 5;k++){ %>
                        <div style="width: 20%;">
                            <% if(data[i].medias[k]){
                                mymedia.push(global.config.imagePath + data[i].medias[k] + '.jpg'); %>
                            <img src="<%= global.config.imagePath + data[i].medias[k] + '.jpg' %>">
                            <% } %>
                        </div>
                        <% } %>
                        <div class="media_data" data-medias="<%= mymedia.join(',')%>"></div>
                    </div>-->
                </div>
            </div>
        <% } %>
            <div style="height: 60px;"></div>
        </div>
    </div>
    <% if(!data.length) { %>
    <div style="padding: 10px 20px;">暂无报修数据</div>
    <% } %>
</div>
<div class="bottomBar">
    <a href="addRepair?openId=<%= session.openId %>" class="weui_btn weui_btn_primary" id="order">新建报修单</a>
</div>

<% include common/footer.ejs %>
<script src="//cdn.bootcss.com/Swiper/3.4.1/js/swiper.min.js"></script>
<script>
    function showImage(el) {
        var tmp = $(el).find('.media_data').data('medias');
        if(tmp) {
            var medias = tmp.split(',');
            if (medias.length > 0) {
                $.photoBrowser({
                    items: medias
                }).open();
            }
        }
    }
    /*$("#order").click(function () {
        location.href="addRepair";
    });*/
</script>
</body>
</html>